import React from "react";

export default function Index() {
  return <div>Car</div>;
}

enum ESex {
  "男" = 0,
  "女",
  "未知",
}

interface ISayHello {
  (msg: string): void;
}

interface IUser {
  name: string;
  age: number;
  sex: ESex;
}

abstract class User implements IUser {
  public name: string;
  public age: number;
  public sex: ESex;
  constructor(name: string, age: number, sex: ESex) {
    this.name = name;
    this.age = age;
    this.sex = sex;
  }
  abstract sayHello(msg: string): void;
}

class Cat extends User {
  sayHello(msg: string) {
    console.log(this.name, this.age, this.sex, msg);
  }
}

const tom = new Cat("Tom", 15, ESex["男"]);
